home *** CD-ROM | disk | FTP | other *** search
-
- README file for the ImportAdvanced application.
-
- This application covers importing and exporting EPS files and TIFF images.
- The important aspects here are caching the image in an NXImage and imaging
- it within an NXEPSImageRep. The NXEPSImageRep switches contexts which
- provides for a more robust recovery when errors are encountered in an EPS file.
- Without a separate context, errors within an EPS file could sink the application's
- context. The NXImage improves scrolling and other areas where quick redrawing
- is necessary.
-
- Other important aspects are the checking of the some of the included resources
- (fonts and files). A panel is displayed showing which resources are missing. If a
- %%IncludeFile: comment is encountered, then a temporary file or memory stream
- is written with the included file or files incorporated into it. Its this file or memory stream
- that's used for imaging. (This is done behind the veil of the NXEPSImageRep, but its
- hope that this functionality will be incorporated into the class at some later point.)
-
- The files can be copied into the document or imported by reference. Unfortunately,
- a little more work needs to be done to allow the user to locate a referenced file if it
- cannot be found. (That's left as an exercise for the reader.)
-
- The saveTo: menu item initiates the path to output the Adobe Illustrator compatible
- code for EPS files. Including a preview image as a comment in the file is also an option
- when saving as EPS.
-
- Another aspect of the application is the user interface. Importing by dragging out
- is possible as well as dropping in. The user can rotate the files and zoom in and out.
- These guidelines are not meant to establish a standard but provide a base from which
- to best decide what may work for a particular application.
-
- Portions of the source code in this application are based on source code
- from the Draw example application provided by NeXT.
-
-
- Below lies an annotated list of the files used in the application. The
- classes listed first form the majority of the application and are
- the more important ones to note. The others fill support roles.
-
- ImportApp - A subclass of Application. Manages the global operations.
- Document - A subclass of Responder. Manages the operations for a document.
- Operations such as import, save, etc.
- DocView - A subclass of View. Resides as the DocView of a ClipView and
- DrawingView. Positions the DrawingView within the ClipView.
- DrawingView - A subclass of View. The view that manages the drawing for a
- document. Contains the list of graphics.
- GraphicImport - A subclass of Object. Each imported eps and tiff file is managed
- through an instance of this object. Uses an NXImage to retain
- the image of the file offscreen and an NXEPSImageRepSub
- to swiche DPS contexts when imaging to protect the application's
- context.
- NXEPSImageRepSub - A subclass of NXEPSImageRep. Adds the resource parsing and
- checking routines, the include file handling and the drawing
- with rotation.
- NXBitmapImageRepSub - A subclass of NXBitmapImageRep. Adds the drawing
- with rotation.
-
- GraphicList - A subclass of List. Acts like a GraphicEpsf object but just passes
- each message on to the elements in the list.
-
- SaveAsPanel - A subclass of SavePanel.
- ResourcePanel - A subclass of Panel that displays the resources specified in the
- Epsf file but not found in the system.
- ImportPanel - A subclass of OpenPanel.
- ScrollingView - A subclass of ScrollView. One method overridden to scroll both the
- DrawingView and the offscreen buffer of the DrawingView.
- Preferences - A subclass of Panel. Uses for setting the preferences.
-
- epsfwraps.psw - Wraps for epsf files.
- epsfreader.m - Routines for parsing Eps files.
- epsfwriter.m - Routines for writing Eps files.
- epsferror.m - Error codes and messages for parsing errors.
-
-
- Topics of interest from ImportAdvanced:
-
- Parsing an Eps file (epsfreader)
- Resource checking and error flagging (epsfreader, GraphicImport, ResourcePanel)
- Imaging an Eps file into an NXImage (GraphicImport)
- Dragging out the place for an Eps file (DrawingView, GraphicImport)
- Saving As EPS/Illustrator (Document, DrawingView, GraphicImport, NXEPSImageRepSub)
-
- Rotating a graphic (DrawingView, GraphicImport, NXEPSImageRepSub,
- NXBitmapImageRepSub rotateprocs)
- Multiple graphics (DrawingView, GraphicList)
- Returning files to their Original Ratio and Original Size (DrawingView, GraphicImport)
- Muliple images per Epsf file (GraphicImport)
- Zooming in and out (DocView, DrawingView)
- Including a Proc Set (DrawingView)
-